<?php
class CategoryEditAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
		$this->layout = 'default';
	}

	public function execute()
	{
		$categoryService = new CategoryService();
		
		$id = $this->context->get('id');
		$pid = $this->context->get('pid');
		
		if(is_numeric($id) && $id)
		{
			$this->data['info']	= $categoryService->get($id);
			$pid = $this->data['info']['pid'];
		}
		
		$this->data['id'] = $id;
		$this->data['pid'] = $pid;
		
		$this->data['menu']	= 'category';
	}
}
